<?php

/**
 * NOTICE OF LICENSE
 *
 * THIS SOURCE FILE IS PART OF EVEBIT'S PRIVATE PROJECT.
 * 
 * DO NOT USE THIS FILE IN OTHER PLACE.
 *
 * @category    ChinaWanderer
 * @package     Blocks
 * @subpackage  Template
 * @author      Chen Qiao <chen.qiao@evebit.com>
 * @version     $$Id: grid.phtml 955 2011-05-23 02:55:26Z chen.qiao $$
 * @copyright   Copyright (c) 2011 Evebit Inc. China (http://www.evebit.com)
 */

$tableTitle = $this->tableTitle;
$tableImage = $this->tableImage;
$state = $this->state;
$colnums = $this->colnums;
$paginator = $this->paginator;
$content = $this->content;
$viewAction=$this->viewAction;
$actionCheck = $this->actionCheck;
if($this->module) {
	$module = $this->module;
} else {
	$module = 'backend/';
}
?>
<div class="content-header" style="visibility: visible;">
    <table cellspacing="0" style="*margin-top:20px;">        
        <tr >
        	<td style="border-bottom:1px dotted #D3D3D3;width:50px;">
        		<img src="<?php echo $this->baseUrl('/media/assets/icons/'.$tableImage)?>" style="padding-left:0px;" alt="" />
        	</td>
            <td style="width: 350px;border-bottom:1px dotted #D3D3D3;">
            	<h2 id="head_title" style="float:left; padding-left: 20px" class="icon-head head-customer"><?php if(!$this->tableShortTitle)
      					echo $tableTitle.$this->__(" Management");
				else
				echo $this->tableShortTitle;
            	?></h2>
            </td>
            
            <td class="form-buttons2" style="border-bottom:1px dotted #D3D3D3;">
            
            <div class="meta" >
            <ul style="padding-top:5px;">
            <?php if($actionCheck == 'check') {?>
            	<li></li>
            <?php } else {?>
            <li>
            	<a href="<?php echo $this->baseUrl($module.$viewAction.'/add')?>" title="<?php echo $this->__("Add New ".$tableTitle) 

?>" class="tooltip">
            	<span class="ui-icon ui-icon-plusthick"></span>
            	<?php echo $this->__("Add New ".$tableTitle) ?>
            	</a>
            </li>
            <li>
            	<a onclick="document.getElementById('<?php echo $viewAction;?>_form').action='<?php echo $this->baseUrl($module.$viewAction.'/delete');?>';document.getElementById('<?php echo $viewAction;?>_form').submit();" title="<?php echo $this->__("Delete ".$tableTitle) 

?>" class="tooltip">
            	<span class="ui-icon ui-icon-trash"></span>
            	<?php echo $this->__("Delete Selected") ?>
            	</a>
            </li>
            <?php }?>
            </ul>
            <div style="width:290px;padding-top:5px;" id="<?php echo $this->grid ?>_massaction" class="">
				<?php echo $this->action(
						'render', 'block', 'blocks',
						array(
				    		'template'=>'grid/massaction',
				    		'massactions'=>array(
								'grid_id'=>$viewAction,
							 	'options'=>$this->massactions,
							 )
				    	)
				    ) ?>
			</div>
            
            </div>
            </td>
        </tr> 
           	
    </table>
</div>
			
<form id="<?php echo $this->viewAction ?>_form" method="post" action="<?php echo $this->action ?>">
	<div>                
	    <div id="<?php echo $this->grid ?>">
	    	
			
			<div class="grid" style="clear:both;float:none;">
				<div class="hor-scroll">
					<table cellspacing="0" id="<?php echo $this->grid ?>_table" class="normal">
						<?php echo $this->action(
								'render', 'block', 'blocks',
								array(
						    		'template'=>'grid/header',
									'state'=>$this->state,	
									'colnums'=>$this->colnums,
								    'buttons'=>$this->buttons,
								    'viewAction'=>$this->viewAction,
									'module'=>$this->module
								)
						    ) ?>	    	    
			    	    <tbody>
			    	         
			    	       
			    	    	<?php echo $this->content ?>		    	    	   	        
			    	    </tbody>
					</table>
					<table  cellspacing="0" class="actions">   
				<tr>
    				<td class="pager" style="font-size:11px;padding-left:100px;">      
				    	<?php echo $this->action(
				    			'render', 'block', 'blocks',
				    			array(
				    				'template'=>'pagination',
				    				'paginator'=>$this->paginator,
				    				'style'=>'sliding'
				    			)
				    		) ?>  
	    			</td>
				    <td class="filter-actions a-right">
				    	<?php echo $this->action(
				    			'render', 'block', 'blocks',
				    			array(
				    				'template'=>'grid/buttons',
				    				'buttons'=>$this->buttons,
				    			)
				    		) ?>
				    </td>
				</tr>
			</table>
				</div>
			</div>
		</div>
	</div>
</form>

